package com.open.httpauto;

import com.alibaba.fastjson2.JSONObject;
import com.open.httpauto.http.Context;
import com.open.httpauto.http.RequestParameter;

import java.util.List;

/**
 * 加密算法枚举
 */
public enum DigestEnum implements IDigestHandler {
    MD5 {
        @Override
        public String md5Sign(List<RequestParameter> requestMap, JSONObject paramJsonObject, Context context) {
            return super.md5Sign(requestMap, paramJsonObject, context);
        }
    },
    AES {
        @Override
        public String aesEncrypt(String data, Context context) {
            return super.aesEncrypt(data, context);
        }

        @Override
        public String aesDecode(String data, Context context) {
            return super.aesDecode(data, context);
        }
    },
    RSA {

    };


    /**
     * 获取枚举
     */
    public static DigestEnum getEnum(String stateName) {
        for (DigestEnum enumName : DigestEnum.values()) {
            if (enumName.name().equalsIgnoreCase(stateName)) {
                return enumName;
            }
        }
        return null;
    }
}
